Skip to content

fix(acp): stop an agent's open question from wedging the thread - #208

Open
nullStack65 wants to merge 2 commits into
release/native-0.1.10from
fix/acp-pending-question-wedge
Open

nullStack65 wants to merge 2 commits into
release/native-0.1.10from
fix/acp-pending-question-wedge

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 25, 2026 •

Copy link
Copy Markdown
Owner

Problem

The CoS thread, running Antigravity on gemini-4-neon, showed repeated "Provider error / Provider turn failed" on Nov 24 from 10:31 to 10:34 PM ET. Typing "continue" also failed.

Root cause

  1. The agent opened a native ask_question. It arrives as session/request_permission, and T3 shows it as a question card.
  2. A delegated-task notification steered the running turn. Antigravity steers with a new session/prompt, and an agent waiting on its own question rejects every prompt (AcpRequestError).
  3. The rejected steer prompt finalized the turn as failed.
  4. On turn.terminal, the server dismissed the pending question in the projection. The ACP adapter never resolved its own pending request, so no native answer went back to the agent.
  5. The agent stayed blocked and rejected every later prompt until the session was torn down.

Evidence from the local agy ACP log: the ask_question for step 3676 started at about 22:27:46 local. From 22:27:53, every session/prompt was rejected. T3 logged 7 AcpRequestErrors from 03:27:54Z to 03:34:10Z. The question was only answered at 22:36:08, during teardown.

Fix (packages/provider-acp/src/server/adapter.ts)

  • finalizeTurn answers the turn's pending runtime requests as cancelled, using a turn-scoped variant of cancelPendingRuntimeRequests. The agent now gets a native answer matching the server-side dismissal, so it stops blocking.
  • steerWithPrompt declines a steer while the turn has a pending question or approval with ProviderAdapterSteerDeclinedError. The orchestrator already handles that error by queueing the message after the active run (queue_after_active), as it does for the Cursor adapter. steerTurn now passes the error through instead of wrapping it in SteerRunError.

Tests

Two new tests in AntigravityAdapterV2.test.ts:

  • "declines a steer while the agent waits on its own question": the steer is declined, no prompt reaches the agent, and the question stays open for the user.
  • "answers the agent's open question when its turn fails": the agent asks while a steer prompt is in flight and rejects that prompt, the turn fails, and the question is answered cancelled.

Both tests fail without the adapter change: one on the assertion, one on the timeout.

Verified on 360c17710e:

  • effect-tsgo tsrs --noEmit passes, exit 0, in packages/provider-acp and apps/server.
  • AntigravityAdapterV2, AcpAdapterV2, AcpRegistryAdapterV2 and SteeringCompletion.integration tests: 304 tests.
    • In the combined run, 303 passed and 1 failed: "fails the turn on an ACP v2 idle error…" missed its 2-second wait.
    • That run shared the machine with a concurrent server typecheck.
    • The failed test passes alone, both with and without this change.
    • A clean rerun of all 148 AcpAdapterV2 tests passed.
  • vp fmt and vp lint are clean on the changed files.

Not verified: a live Antigravity session reproducing the incident end to end.

Fork-freeze note (CLO-1110, the fork freeze and upstream catch-up decision)

This is a reliability fix and adds no feature surface. Upstream pingdotgg/t3code main has the same code path, so this is a fork-only commit that the upstream catch-up must carry.

Related

  • CLO-1067, the Antigravity ACP permission-timeouts issue (Blocked), covers the same native-permission area. This PR does not change it.

Deploy: fleet

🤖 Generated with Claude Code

When an Antigravity agent waits on its own ask_question, it rejects every new
session/prompt. A steer such as a delegated-task notification was sent anyway,
failed the turn, and turn.terminal dismissed the question on the server while
the adapter never answered the agent. The agent stayed blocked, and every later
prompt failed with "Provider turn failed" until the session was torn down.

- finalizeTurn now resolves the turn's pending runtime requests as cancelled,
  so the agent gets a native answer matching the server-side dismissal.
- steerWithPrompt declines a steer while the turn has a pending request, so
  the orchestrator queues it after the active run instead of failing the turn.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@nullStack65

Copy link
Copy Markdown
Owner Author

Checkpoint, head 360c17710e9e84684866654fc7f4008695661281

  • Scope: the "Provider turn failed" loop in Antigravity threads, where an agent waits on its own question and rejects a steer prompt. Linear is read-only from this session and repo issues are turned off, so this PR is the record.
  • Done: fix committed and pushed; typecheck passes for provider-acp and server; new regression tests fail without the fix and pass with it; all 148 AcpAdapterV2 tests pass on a clean rerun.
  • Next: one independent review round. No human reviewer has been requested.

Review follow-up. The server dismisses a turn's pending user-input requests
at turn.terminal, not its approvals, so the adapter now answers only those.
Approvals keep their existing behaviour. The regression test also checks for
exactly one cancelled update per question.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@nullStack65

Copy link
Copy Markdown
Owner Author

Result, head 94cda9b8a5c7fdbb5301176c77aff5a0666e87ae

  • Review round (one, independent, Claude Opus 5.5 in a fresh context after the Codex reviewer hit its usage limit): approve, no important findings. It found no deadlock, no duplicate cancelled events, no endless re-queue of declined steers, and no effect on other ACP flavors.
  • Repaired in 94cda9b8a5c7fdbb5301176c77aff5a0666e87ae:
    • At turn end the adapter now cancels only the turn's pending questions (user_input), which is exactly what the server's dismissNativeUserInputs dismisses. Approvals keep their old behaviour, so a generic ACP agent's approval is no longer denied when a turn completes.
    • The turn-failure test now asserts exactly one cancelled runtime_request.updated per question.
  • Left as is (review said optional): a steer landing in the moment between the user's answer and the request's removal is queued instead of sent. It delays delivery but does not wedge.
  • Verified on 94cda9b8a5c7fdbb5301176c77aff5a0666e87ae: effect-tsgo tsrs --noEmit exit 0 for packages/provider-acp and apps/server; AntigravityAdapterV2 32/32; AcpAdapterV2, AcpRegistryAdapterV2 and SteeringCompletion.integration 272/272; vp fmt and vp lint clean on changed files.
  • Not verified: a live Antigravity session reproducing the incident end to end.
  • Remaining: Kameron's review and merge. No other human reviewer requested.

@nullStack65

Copy link
Copy Markdown
Owner Author

CHECKPOINT: head 94cda9b8a5c7fdbb5301176c77aff5a0666e87ae. Not merged.

I reran the failed jobs (CI run 45548889249, attempt 2):

  • Core: passed. Attempt 1 had failed on a runner DNS timeout while installing libatomic.
  • Web: passed.
  • Mobile: failed again in "Gate interaction latency at 400 ms". The error was Failed to connect to the browser session ... [latency (chromium)] within the timeout, and it reported Tests: no tests, so no latency was ever measured. This is the same error as attempt 1.
  • Voice + founder inbox: this required check sums up the jobs above, so it fails because the mobile job did.

This PR changes only packages/provider-acp/src/server/adapter.ts and apps/server/.../AntigravityAdapterV2.test.ts. It doesn't touch apps/web.

The same workflow passed on other PRs at 03:46, 04:16 and 04:23 UTC. That fits an intermittent Chromium-startup problem on the ARC runner, not a regression in this PR. Even so, this job has failed twice in a row here, so I'm holding the merge and not rerunning it again myself. I couldn't find a Linear issue tracking this browser-connect timeout, so it needs to go to ARC Ops (the CI runner owner).

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants